import axios from "axios";

export default{
    // 创建actions

    //因为actions中一定会调用commit去调用mutation,所以action中的函数,接受一个对象,对象中提供一个commit方法
    incrementWait({ commit }) {
      setTimeout(() => {
        commit("increment");
      }, 1000);
    },
  
    incrementNWait({ commit }, payload) {
      setTimeout(() => {
        commit("incrementN", payload);
      }, 1000);
    },
    async getMovieList({ commit }) {
      const result = await axios.get(
        "https://pcw-api.iqiyi.com/search/recommend/list?channel_id=1&data_type=1&mode=11&page_id=2&ret_num=48&session=b9fd987164f6aa47fad266f57dffaa6a"
      );
      commit("getmovieList", result.data.data.list);
    },
 
  
}